package com.cskaoyan.bean.usersadmin;

import com.cskaoyan.bean.po.MarketSearchHistory;
import lombok.Data;

import java.util.List;

/**
 * ClassName: SearchHistoryData
 * Description:
 * date: 2022/6/5 20:54
 *
 * @author bruce
 * @since JDK 8
 */
@Data
public class SearchHistoryData {

    /**
     * total : 6
     * pages : 1
     * limit : 20
     * page : 1
     * list : [{"id":224,"userId":1,"keyword":"母亲节","from":"wx","addTime":"2022-05-11 15:29:06","updateTime":"2022-05-11 15:29:06","deleted":false},{"id":223,"userId":1,"keyword":"母亲节","from":"wx","addTime":"2022-05-11 14:26:49","updateTime":"2022-05-11 14:26:49","deleted":false}]
     */

    private int total;
    private int pages;
    private int limit;
    private int page;
    private List<MarketSearchHistory> list;

    public static SearchHistoryData data(long total, int pages, int limit, int page, List<MarketSearchHistory> list) {
        SearchHistoryData searchHistoryData = new SearchHistoryData();
        searchHistoryData.setTotal((int) total);
        searchHistoryData.setPages(pages);
        searchHistoryData.setLimit(limit);
        searchHistoryData.setPage(page);
        searchHistoryData.setList(list);
        return searchHistoryData;
    }
}
